package controllers;

import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;

import javax.swing.JPanel;


public class InputHandler implements KeyListener {
	
	public Game game;

	public InputHandler(JPanel game) {
		this.game = (Game) game;
	}

	@Override
	public void keyPressed(KeyEvent key) {
		
		//TODO change all this configuration, is deprecated
		if(key.getKeyCode() == KeyEvent.VK_RIGHT){
			game.stage.doScroll(0);
			
		}else if(key.getKeyCode() == KeyEvent.VK_LEFT){
			game.stage.doScroll(1);
		}
	}

	@Override
	public void keyReleased(KeyEvent key) {
		

	}

	@Override
	public void keyTyped(KeyEvent key) {
		
	}
	
	

}
